import { Component, OnInit } from '@angular/core';
import {Router} from "@angular/router";
import {DiskPageStatus} from "@core/service/page/DiskPageStatus";
import {SharePageService} from "@core/service/page/SharePageService";

@Component({
  selector: 'bby-share-disk',
  templateUrl: './share-disk.component.html',
  styleUrls: ['./share-disk.component.scss']
})
export class ShareDiskComponent implements OnInit {
  loading = false;
  constructor(
    private router:Router,
    public sharePage:SharePageService
  ) {
    // this.loadList(1);
  }

  ngOnInit(): void {
  }


  goBack() {
    this.router.navigate(['/share']);
  }
  subTitle():string{
    switch (this.sharePage.pageName){
      case "disk": return this.sharePage.pageStatus.owner.username+' 的网盘';
      case "file": return '搜素文件：'+this.sharePage.searchValue;
      case "user": return '搜索用户：'+this.sharePage.searchValue;
    }
    return ''
  }

  searchClick() {
    if (!this.sharePage.searchValue){
      return
    }
    let param = {
      search:this.sharePage.searchValue,
      page:1
    }
    this.router.navigate(['/share/'+this.sharePage.searchModel],{queryParams:param});
  }
}
